<template>
	<keep-alive include="com">
		<component :is="active"></component>
	</keep-alive>
</template>
  
  <script>
export default {
	components: {
		com: () => import('./components/com.vue'), // 组件
		position: () => import('./components/position.vue') // 定位
	},
	data() {
		return {
			active: 'com',
			obj: {
				1: 'com',
				2: 'com',
				3: 'position',
			}
		}
	},
	computed: {},
	provide() {
		return {
			parent: this
		}
	},
	created() {
		if (this.$route.query.num) {
			for (const key in this.obj) {
				if (key === this.$route.query.num) {
					this.active = this.obj[key]
				}
			}
		}
	},
	mounted() {},
	methods: {
		changeCom(type) {
			this.active = type
		}
	}
}
</script>
  
  <style scoped></style>
  